/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package View;

import Database.BazaDate;
import java.awt.Dimension;
import java.nio.channels.Selector;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author Reneul
 */
public class ViewMenu extends JPanel{
    public Dimension d;
    public ViewMenu(Dimension d) throws SQLException{
        this.d=d;
        this.setPreferredSize(d);
        String [] ListaAlgo;
        ListaAlgo = new String [9];
        ListaAlgo [1] = "DepthSearch";
        ListaAlgo [2] = "DepthLimitedSearch";
        ListaAlgo [3] = "WidthSearch";
        ListaAlgo [4] = "UniformCostSearch";
        ListaAlgo [5] = "IteratedDeepingSearch";
        ListaAlgo [6] = "Dijsktra";
        JComboBox Algoritmi = new JComboBox (ListaAlgo);
        String [] ListaStatii;
        BazaDate bd = new BazaDate();
        bd.conecteaza();
        ResultSet rez;
        ListaStatii = new String [400];
        rez = bd.doQuery("select * from statii");
        int j = 0;
        while (rez.next()) {
            ListaStatii[j] = rez.getString(2);
            j++;
        }
        JComboBox Statii1 = new JComboBox (ListaStatii);
        JComboBox Statii2 = new JComboBox (ListaStatii);
        JTextField testText = new JTextField(20);
        JButton testBtn = new JButton("Test");
        JButton reset = new JButton("Run");
        JButton btnCoordonate = new JButton("Coordonate");
        this.add(Algoritmi);
        this.add(Statii1);
        this.add(Statii2);
        this.add(reset);
    }
}
